package com.example.mapper;

import com.example.pojo.Room;
import com.example.pojo.RoomType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoomTypeMapper {
    List<RoomType> selectAll(RoomType roomType);

    @Select("select * from room_Type where id = #{id}")
    RoomType selectById(Integer id);

    Integer add(RoomType roomType);

    void updateById(RoomType roomType);

    @Delete("delete from room_Type where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from room_Type where name = #{name}")
    RoomType selectByname(String name);

    /**
     * 更新房间类型的房间数量
     */
    void updateRoomCount(@Param("typeId") Integer typeId,@Param("count") Integer count);
}

